import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../providers/theme_provider.dart';

class HomeScreen extends StatelessWidget {
  const HomeScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final themeProvider = Provider.of<ThemeProvider>(context);

    return Scaffold(
      appBar: AppBar(
        title: const Text('健康助手'),
        actions: [
          // 深色模式切换按钮
          IconButton(
            icon: Icon(
                themeProvider.isDarkMode ? Icons.light_mode : Icons.dark_mode),
            tooltip: '切换深色模式',
            onPressed: () {
              themeProvider.toggleTheme();
            },
          ),
          // 主题设置按钮
          IconButton(
            icon: const Icon(Icons.color_lens),
            tooltip: '主题设置',
            onPressed: () {
              Navigator.pushNamed(context, '/theme_settings');
            },
          ),
          // 添加关于按钮
          IconButton(
            icon: const Icon(Icons.info_outline),
            tooltip: '关于',
            onPressed: () {
              Navigator.pushNamed(context, '/about');
            },
          ),
        ],
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Text(
              '欢迎使用健康助手',
              style: TextStyle(fontSize: 24),
            ),
            const SizedBox(height: 20),
            // 其他内容...
          ],
        ),
      ),
    );
  }
}
